ALMaSS  1.0
The Animal, Landscape and Man Simulation System
Skylark_PreFledgeling Class Reference

#include <skylarks_all.h>

Inheritance diagram for Skylark_PreFledgeling:
Skylark_Nestling Skylark_Base TAnimal TALMaSSObject

Public Member Functions

 Skylark_PreFledgeling (int x, int y, Landscape *L, SkTerritories *Terrs, Skylark_Male *Daddy, bool sex, double size, int age, Skylark_Population_Manager *SPM, int bx, int by, int mh)
 
virtual void ReInit (int x, int y, Landscape *L, SkTerritories *Terrs, Skylark_Male *Daddy, bool sex, double size, int age, Skylark_Population_Manager *SPM, int bx, int by, int mh)
 
virtual void BeginStep (void)
 BeingStep behaviour - must be implemented in descendent classes. More...
 
virtual void Step (void)
 Step behaviour - must be implemented in descendent classes. More...
 
virtual void EndStep (void)
 EndStep behaviour - must be implemented in descendent classes. More...
 
- Public Member Functions inherited from Skylark_Nestling
 Skylark_Nestling (int x, int y, Skylark_Male *Daddy, Landscape *L, SkTerritories *Terrs, Skylark_Population_Manager *SPM, int bx, int by, int mh)
 
virtual void ReInit (int x, int y, Skylark_Male *Daddy, Landscape *L, SkTerritories *Terrs, Skylark_Population_Manager *SPM, int bx, int by, int mh)
 
virtual double On_FoodSupply (double food)
 
void OnDadDead ()
 
void OnYouHaveBeenEaten ()
 
void OnDeserted ()
 
- Public Member Functions inherited from Skylark_Base
 Skylark_Base (int x, int y, SkTerritories *Terrs, Landscape *L, Skylark_Population_Manager *SPM, int bx, int by, int mh)
 
virtual void ReInit (int x, int y, SkTerritories *Terrs, Landscape *L, Skylark_Population_Manager *SPM, int bx, int by, int mh)
 
void AddStriglingMort (int lifestage)
 
virtual int WhatState ()
 
bool InSquare (rectangle R)
 
- Public Member Functions inherited from TAnimal
unsigned SupplyFarmOwnerRef ()
 
AnimalPosition SupplyPosition ()
 
APoint SupplyPoint ()
 
int SupplyPolygonRef ()
 
int Supply_m_Location_x ()
 
int Supply_m_Location_y ()
 
virtual void KillThis ()
 
virtual void CopyMyself ()
 
void SetX (int a_x)
 
void SetY (int a_y)
 
 TAnimal (int x, int y, Landscape *L)
 
virtual void ReinitialiseObject (int x, int y, Landscape *L)
 Used to re-use an object - must be implemented in descendent classes. More...
 
virtual void Dying ()
 
void CheckManagement (void)
 
void CheckManagementXY (int x, int y)
 
- Public Member Functions inherited from TALMaSSObject
int GetCurrentStateNo ()
 Returns the current state number. More...
 
void SetCurrentStateNo (int a_num)
 Sets the current state number. More...
 
bool GetStepDone ()
 Returns the step done indicator flag. More...
 
void SetStepDone (bool a_bool)
 Sets the step done indicator flag. More...
 
virtual void ReinitialiseObject ()
 Used to re-use an object - must be implemented in descendent classes. More...
 
 TALMaSSObject ()
 The constructor for TALMaSSObject. More...
 
virtual ~TALMaSSObject ()
 The destructor for TALMaSSObject. More...
 
void OnArrayBoundsError ()
 Used for debugging only, tests basic object properties. More...
 

Protected Member Functions

virtual int st_Developing ()
 
virtual void st_Maturing ()
 
virtual void st_Dying ()
 
double GetFood ()
 
double GetFledgelingEM (int Age)
 
virtual bool OnFarmEvent (FarmToDo event)
 
virtual void PesticideResponse ()
 
- Protected Member Functions inherited from Skylark_Base
bool DailyMortality (int mort)
 
- Protected Member Functions inherited from TAnimal
void CorrectWrapRound ()
 Corrects wrap around co-ordinate problems. More...
 

Additional Inherited Members

- Public Attributes inherited from Skylark_Base
double m_pesticide_accumulation
 
double m_pcide_conc
 
TTypesOfSkState m_CurrentSkState
 
int Age
 
double m_Size
 
int m_Born_x
 
int m_Born_y
 
int m_MyHome
 The vegetation type where the skylark was born. More...
 
SkTerritoriesm_OurTerritories
 
Skylark_Population_Managerm_OurPopulationManager
 
- Protected Attributes inherited from Skylark_Nestling
bool Sex
 
int m_EM_fail
 
int m_NestLeavingChance
 
Skylark_Malem_Dad
 
double m_EM
 
double m_GrNeed
 
- Protected Attributes inherited from TAnimal
int m_Location_x
 
int m_Location_y
 
Landscapem_OurLandscape
 
- Protected Attributes inherited from TALMaSSObject
int m_CurrentStateNo
 The basic state number for all objects - '-1' indicates death. More...
 
bool m_StepDone
 Indicates whether the iterative step code is done for this timestep. More...
 

Constructor & Destructor Documentation

◆ Skylark_PreFledgeling()

Skylark_PreFledgeling::Skylark_PreFledgeling ( int  x,
int  y,
Landscape L,
SkTerritories Terrs,
Skylark_Male Daddy,
bool  sex,
double  size,
int  age,
Skylark_Population_Manager SPM,
int  bx,
int  by,
int  mh 
)
3361  :
3362  Skylark_Nestling(x, y, Daddy, L, Terrs, SPM, bx, by, mh) {
3363  Sex = sex; // must be reset because the nestling constructor can change it
3364  m_Size = size;
3365  Age = age;
3366  m_EM = 0;
3367  m_GrNeed = 0;
3368  m_CurrentSkState = toss_PDeveloping; // must develop today
3369 }
double m_Size
Definition: skylarks_all.h:596
int Age
Definition: skylarks_all.h:595
TTypesOfSkState m_CurrentSkState
Definition: skylarks_all.h:594
bool Sex
Definition: skylarks_all.h:681
double m_EM
Definition: skylarks_all.h:686
double m_GrNeed
Definition: skylarks_all.h:687
Skylark_Nestling(int x, int y, Skylark_Male *Daddy, Landscape *L, SkTerritories *Terrs, Skylark_Population_Manager *SPM, int bx, int by, int mh)
Definition: skylarks_all.cpp:2933
@ toss_PDeveloping
Definition: skylarks_all.h:51

References Skylark_Base::Age, Skylark_Base::m_CurrentSkState, Skylark_Nestling::m_EM, Skylark_Nestling::m_GrNeed, Skylark_Base::m_Size, Skylark_Nestling::Sex, and toss_PDeveloping.

Member Function Documentation

◆ BeginStep()

void Skylark_PreFledgeling::BeginStep ( void  )
virtual

BeingStep behaviour - must be implemented in descendent classes.

Reimplemented from Skylark_Nestling.

3488  {
3489  CheckManagement();
3490 }
void CheckManagement(void)
Definition: PopulationManager.cpp:1404

References TAnimal::CheckManagement().

◆ EndStep()

void Skylark_PreFledgeling::EndStep ( void  )
virtual

EndStep behaviour - must be implemented in descendent classes.

Reimplemented from Skylark_Nestling.

3525  {
3526 #ifdef __CJTDebug_5
3527  if ( IsAlive() != 0x0DEADC0DE ) DEADCODEError();
3528 #endif
3529  if ( m_CurrentSkState == toss_Destroy ) return;
3530 #ifdef __CJTDebug_5
3531  if ( Dad )
3532  if ( !Dad->DoIExistP( this ) ) {
3533  g_land->Warn( "Skylark_PreFeldgeling::EndStep(): DeBug5 ", NULL );
3534  exit( 1 );
3535  }
3536 #endif
3537  switch ( m_CurrentSkState ) {
3538  case toss_PDeveloping: // Develop
3539  switch ( st_Developing() ) {
3540  case 2:
3541 #ifdef TEST_ISSUE_DEATH_WARRANT
3542  printf( "Skylark_PreFledgeling::EndStep() : st_Developing() : %d\n", ( int )g_date->Date() );
3543 #endif
3544  m_CurrentSkState = toss_PDying; // -> die
3545  break;
3546  case 1:
3547  m_CurrentSkState = toss_PMaturing; // -> Maturing
3548  // This state must be completed now so make the call from here to stop
3549  // it being made the next day
3550  st_Maturing();
3551  m_CurrentSkState = toss_Destroy; // will kill it at end of step!
3552  m_CurrentStateNo = -1;
3553  m_StepDone = true;
3554  break;
3555  }
3556  break;
3557  case 8: // Maturing
3558  g_land->Warn( "Skylark_PreFledling::EndStep(): Maturing ", NULL );
3559  exit( 1 );
3560  case 9: // Dying
3561  st_Dying();
3562  m_StepDone = true;
3563  break;
3564  default:
3565  /* char errornum[20]; sprintf(errornum, "%d", m_CurrentSkState );
3566  g_land->Warn("Skylark_PreFledgeling::EndStep(): Unknown state: ", errornum); exit(0); */
3567  break;
3568  }
3569  // Need to find out if it is poisoned
3570 #ifdef __PESTICIDE_RA
3572 #endif
3573 }
class Calendar * g_date
Definition: calendar.cpp:38
long Date(void)
Definition: calendar.h:57
void Warn(std::string a_msg1, std::string a_msg2)
Definition: landscape.h:1579
virtual void PesticideResponse()
Definition: skylarks_all.cpp:6835
virtual int st_Developing()
Definition: skylarks_all.cpp:3588
virtual void st_Dying()
Definition: skylarks_all.cpp:3577
virtual void st_Maturing()
Definition: skylarks_all.cpp:3643
bool m_StepDone
Indicates whether the iterative step code is done for this timestep.
Definition: PopulationManager.h:118
int m_CurrentStateNo
The basic state number for all objects - '-1' indicates death.
Definition: PopulationManager.h:116
Landscape * g_land
This pointer provides access the to landscape module.
Definition: skylarks_all.cpp:49
@ toss_Destroy
Definition: skylarks_all.h:62
@ toss_PDying
Definition: skylarks_all.h:51
@ toss_PMaturing
Definition: skylarks_all.h:51

References Calendar::Date(), g_date, g_land, Skylark_Base::m_CurrentSkState, TALMaSSObject::m_CurrentStateNo, TALMaSSObject::m_StepDone, PesticideResponse(), st_Developing(), st_Dying(), st_Maturing(), toss_Destroy, toss_PDeveloping, toss_PDying, toss_PMaturing, and Landscape::Warn().

◆ GetFledgelingEM()

double Skylark_PreFledgeling::GetFledgelingEM ( int  Age)
protected
3632  {
3633 #ifdef __CJTDebug_5
3634  if ( IsAlive() != 0xDEADC0DE )
3635  DEADCODEError();
3636 #endif
3637  // Speed optimisation - this is the same for every bird so done in PopMan
3638  return m_OurPopulationManager->SupplyEMi(); // in gdw needed
3639 }
Skylark_Population_Manager * m_OurPopulationManager
Definition: skylarks_all.h:603
double SupplyEMi()
Definition: skylarks_all.h:558

References Skylark_Base::m_OurPopulationManager, and Skylark_Population_Manager::SupplyEMi().

◆ GetFood()

double Skylark_PreFledgeling::GetFood ( )
protected
3611  {
3612 #ifdef __CJTDebug_5
3613  if ( IsAlive() != 0x0DEADC0DE ) DEADCODEError();
3614 #endif
3615  // Food it obtained from the local area
3616  // This will depend upon the habitat quality/weather & searching efficiency
3617  // This is possibly too complicated just now so:
3618  // First prototype model will assume that for the last 10 days the birds
3619  // can find 10% of their need for each day after 20 days so at 30 days they
3620  // are completely independent and cannot starve
3621 
3622  // 1st prototype
3623  double food;
3624  if (Age>=20) {
3625  food = m_OurPopulationManager->SupplyEMi() * 0.1 * ( Age - 20 );
3626  } else food=0;
3627  return food;
3628 }

References Skylark_Base::Age, Skylark_Base::m_OurPopulationManager, and Skylark_Population_Manager::SupplyEMi().

◆ OnFarmEvent()

bool Skylark_PreFledgeling::OnFarmEvent ( FarmToDo  event)
protectedvirtual

Reimplemented from Skylark_Nestling.

3383  {
3384  switch ( event ) {
3385  case sleep_all_day:
3386  case fp_npks:
3387  case fp_npk:
3388  case fp_pk:
3389  case fp_slurry:
3390  case fp_manganesesulphate:
3391  case fp_manure:
3392  case fp_greenmanure:
3393  case fp_sludge:
3394  case fa_npk:
3395  case fa_pk:
3396  case fa_slurry:
3397  case fa_ammoniumsulphate:
3398  case fa_manure:
3399  case fa_greenmanure:
3400  case fa_sludge:
3401  case herbicide_treat:
3402  case growth_regulator:
3403  case fungicide_treat:
3404  case insecticide_treat:
3406  case molluscicide:
3407  case row_cultivation:
3408  case water:
3409  case swathing:
3410  case harvest:
3411  case cattle_out:
3412  case cattle_out_low:
3413  case hay_bailing:
3414  case mow:
3415  case cut_weeds:
3416  case pigs_out:
3417  break;
3418 
3419  case autumn_harrow:
3420  case autumn_roll:
3421  case autumn_sow:
3422  case winter_plough:
3423  case deep_ploughing:
3424  case spring_plough:
3425  case spring_harrow:
3426  case spring_roll:
3427  case spring_sow:
3428  case autumn_plough:
3429  case hilling_up:
3430  case cut_to_hay:
3431  case cut_to_silage:
3432  case straw_chopping:
3433  case hay_turning:
3434  case stubble_harrowing:
3436  case burn_straw_stubble:
3437  if ( Age <= 20 ) {
3438 #ifdef TEST_ISSUE_DEATH_WARRANT
3439  printf( "Skylark_PreFledgeling::OnFarmEvent() : %d : %d\n", event, ( int )g_date->Date() );
3440 #endif
3442  }
3443  break;
3444 
3445  case fp_liquidNH3:
3446  break;
3447 
3448 
3449  case syninsecticide_treat:
3450  if ( random( 1000 ) < cfg_insecticide_direct_mortP.value() ) {
3451 #ifdef TEST_ISSUE_DEATH_WARRANT
3452  printf( "Skylark_PreFledgeling::OnFarmEvent() : %d : %d\n", event, ( int )g_date->Date() );
3453 #endif
3455  }
3456  break;
3457 
3458 
3459  case strigling_sow:
3460  case strigling:
3461 #ifndef __NoStriglingEffect
3462  if ( ( Age <= 20 ) && ( random( 100 ) < 50 ) ) {
3463  #ifdef TEST_ISSUE_DEATH_WARRANT
3464  printf( "Skylark_PreFledgeling::OnFarmEvent() : %d : %d\n", event, ( int )g_date->Date() );
3465  #endif
3467  AddStriglingMort( 3 );
3468  }
3469 #endif
3470  break;
3471 
3472  case product_treat:
3473  break;
3474  case glyphosate:
3475  break;
3476 
3477  default:
3478  g_land->Warn( "Skylark_PreFledgeling::OnFarmEvent(): ""Unknown event type:",
3479  m_OurLandscape->EventtypeToString( event ) );
3480  exit( 1 );
3481  }
3482  if ( m_CurrentSkState == toss_PDying ) return true; else
3483  return false;
3484 }
int random(int a_range)
Definition: ALMaSS_CmdLine.cpp:142
int value(void)
Definition: configurator.h:98
std::string EventtypeToString(int a_event)
Definition: Landscape.cpp:3918
void AddStriglingMort(int lifestage)
Definition: skylarks_all.h:611
Landscape * m_OurLandscape
Definition: PopulationManager.h:229
CfgInt cfg_insecticide_direct_mortP
@ burn_straw_stubble
Definition: treatment.h:92
@ autumn_harrow
Definition: treatment.h:37
@ swathing
Definition: treatment.h:81
@ fa_pk
Definition: treatment.h:62
@ winter_plough
Definition: treatment.h:42
@ strigling
Definition: treatment.h:77
@ fp_npks
Definition: treatment.h:48
@ glyphosate
Definition: treatment.h:102
@ fa_sludge
Definition: treatment.h:68
@ fp_liquidNH3
Definition: treatment.h:51
@ spring_roll
Definition: treatment.h:46
@ fa_greenmanure
Definition: treatment.h:67
@ spring_plough
Definition: treatment.h:44
@ molluscicide
Definition: treatment.h:75
@ syninsecticide_treat
Definition: treatment.h:99
@ hay_turning
Definition: treatment.h:88
@ autumn_roll
Definition: treatment.h:38
@ fp_manure
Definition: treatment.h:55
@ deep_ploughing
Definition: treatment.h:43
@ pigs_out
Definition: treatment.h:84
@ fa_npk
Definition: treatment.h:61
@ herbicide_treat
Definition: treatment.h:71
@ row_cultivation
Definition: treatment.h:76
@ spring_sow
Definition: treatment.h:47
@ fungicide_treat
Definition: treatment.h:73
@ fp_manganesesulphate
Definition: treatment.h:53
@ harvest
Definition: treatment.h:82
@ cut_to_silage
Definition: treatment.h:86
@ sleep_all_day
Definition: treatment.h:33
@ mow
Definition: treatment.h:93
@ fa_ammoniumsulphate
Definition: treatment.h:65
@ autumn_plough
Definition: treatment.h:34
@ straw_chopping
Definition: treatment.h:87
@ fa_manure
Definition: treatment.h:66
@ fp_greenmanure
Definition: treatment.h:56
@ fa_slurry
Definition: treatment.h:63
@ product_treat
Definition: treatment.h:101
@ stubble_harrowing
Definition: treatment.h:90
@ hilling_up
Definition: treatment.h:79
@ growth_regulator
Definition: treatment.h:72
@ insecticide_treat
Definition: treatment.h:74
@ trial_insecticidetreat
Definition: treatment.h:96
@ cattle_out_low
Definition: treatment.h:100
@ cut_to_hay
Definition: treatment.h:85
@ cut_weeds
Definition: treatment.h:94
@ fp_sludge
Definition: treatment.h:57
@ autumn_sow
Definition: treatment.h:41
@ fp_npk
Definition: treatment.h:49
@ fp_pk
Definition: treatment.h:50
@ hay_bailing
Definition: treatment.h:89
@ spring_harrow
Definition: treatment.h:45
@ strigling_sow
Definition: treatment.h:95
@ cattle_out
Definition: treatment.h:83
@ fp_slurry
Definition: treatment.h:52
@ water
Definition: treatment.h:80
@ autumn_or_spring_plough
Definition: treatment.h:91

References Skylark_Base::AddStriglingMort(), Skylark_Base::Age, autumn_harrow, autumn_or_spring_plough, autumn_plough, autumn_roll, autumn_sow, burn_straw_stubble, cattle_out, cattle_out_low, cfg_insecticide_direct_mortP, cut_to_hay, cut_to_silage, cut_weeds, Calendar::Date(), deep_ploughing, Landscape::EventtypeToString(), fa_ammoniumsulphate, fa_greenmanure, fa_manure, fa_npk, fa_pk, fa_sludge, fa_slurry, fp_greenmanure, fp_liquidNH3, fp_manganesesulphate, fp_manure, fp_npk, fp_npks, fp_pk, fp_sludge, fp_slurry, fungicide_treat, g_date, g_land, glyphosate, growth_regulator, harvest, hay_bailing, hay_turning, herbicide_treat, hilling_up, insecticide_treat, Skylark_Base::m_CurrentSkState, TAnimal::m_OurLandscape, molluscicide, mow, pigs_out, product_treat, random(), row_cultivation, sleep_all_day, spring_harrow, spring_plough, spring_roll, spring_sow, straw_chopping, strigling, strigling_sow, stubble_harrowing, swathing, syninsecticide_treat, toss_PDying, trial_insecticidetreat, CfgInt::value(), Landscape::Warn(), water, and winter_plough.

◆ PesticideResponse()

void Skylark_PreFledgeling::PesticideResponse ( void  )
protectedvirtual

Reimplemented from Skylark_Nestling.

6835  {
6837  // NOEL triggered, so we need to die
6839  }
6841 }
double value(void)
Definition: configurator.h:118
double m_pesticide_accumulation
Definition: skylarks_all.h:592
CfgFloat cfg_Skylark_prefledegling_Biodegredation
CfgFloat cfg_Skylark_prefledegling_NOEL

References cfg_Skylark_prefledegling_Biodegredation, cfg_Skylark_prefledegling_NOEL, Skylark_Base::m_CurrentSkState, Skylark_Base::m_pesticide_accumulation, toss_PDying, and CfgFloat::value().

Referenced by EndStep().

◆ ReInit()

void Skylark_PreFledgeling::ReInit ( int  x,
int  y,
Landscape L,
SkTerritories Terrs,
Skylark_Male Daddy,
bool  sex,
double  size,
int  age,
Skylark_Population_Manager SPM,
int  bx,
int  by,
int  mh 
)
virtual
3372  {
3373  Skylark_Nestling::ReInit(x, y, Daddy, L, Terrs, SPM, bx, by, mh);
3374  Sex = sex; // must be reset because the nestling constructor can change it
3375  m_Size = size;
3376  Age = age;
3377  m_EM = 0;
3378  m_GrNeed = 0;
3379  m_CurrentSkState = toss_PDeveloping; // must develop today
3380 }
virtual void ReInit(int x, int y, Skylark_Male *Daddy, Landscape *L, SkTerritories *Terrs, Skylark_Population_Manager *SPM, int bx, int by, int mh)
Definition: skylarks_all.cpp:2950

References Skylark_Base::Age, Skylark_Base::m_CurrentSkState, Skylark_Nestling::m_EM, Skylark_Nestling::m_GrNeed, Skylark_Base::m_Size, Skylark_Nestling::ReInit(), Skylark_Nestling::Sex, and toss_PDeveloping.

◆ st_Developing()

int Skylark_PreFledgeling::st_Developing ( )
protectedvirtual

Reimplemented from Skylark_Nestling.

3588  {
3589 #ifdef __CJTDebug_5
3590  if ( IsAlive() != 0x0DEADC0DE ) DEADCODEError();
3591 #endif
3592  // Timing: called at the end of each day
3593  if ( DailyMortality( PreFledgeMortProb ) ) {
3594  //m_OurPopulationManager->WriteToTest2File(m_OurLandscape->SupplyDayInYear(),3001);
3595  return 2; //transfer to state die
3596  }
3597  if ( Age++ == 31 ) {
3598  //m_OurPopulationManager->WriteToTest2File((int)3000, 3000);
3599  m_Size = 38.0; // Give it a size
3600  return 1; // Next stage
3601  } else {
3602  // Get Next days EM
3603  m_EM = 0; // m_OurPopulationManager->SupplyEMi(); // KCal
3604  m_GrNeed = 0; // gdw
3605  return 0; // still developing
3606  }
3607 }
bool DailyMortality(int mort)
Definition: skylarks_all.cpp:2464
static int PreFledgeMortProb
Definition: skylarks_all.cpp:178

References Skylark_Base::Age, Skylark_Base::DailyMortality(), Skylark_Nestling::m_EM, Skylark_Nestling::m_GrNeed, Skylark_Base::m_Size, and PreFledgeMortProb.

Referenced by EndStep().

◆ st_Dying()

void Skylark_PreFledgeling::st_Dying ( void  )
protectedvirtual

Reimplemented from Skylark_Nestling.

3577  {
3578 #ifdef __CJTDebug_5
3579  if ( IsAlive() != 0x0DEADC0DE ) DEADCODEError();
3580 #endif
3581  if ( m_Dad != NULL ) m_Dad->OnPreFledgelingDeath( this );
3582  m_CurrentSkState = toss_Destroy; // will kill it at end of step!
3583  m_CurrentStateNo = -1;
3584 }
void OnPreFledgelingDeath(Skylark_PreFledgeling *P)
Definition: skylarks_all.cpp:4458
Skylark_Male * m_Dad
Definition: skylarks_all.h:685

References Skylark_Base::m_CurrentSkState, TALMaSSObject::m_CurrentStateNo, Skylark_Nestling::m_Dad, Skylark_Male::OnPreFledgelingDeath(), and toss_Destroy.

Referenced by EndStep().

◆ st_Maturing()

void Skylark_PreFledgeling::st_Maturing ( )
protectedvirtual

Reimplemented from Skylark_Nestling.

3643  {
3644 #ifdef __CJTDebug_5
3645  if ( IsAlive() != 0x0DEADC0DE ) DEADCODEError();
3646 #endif
3647  // Timing: occurs at the end of the day
3648  // Mortality after this time, until they return is taken up in the
3649  // immigration mortality (total 35%)
3650  AdultSkylark_struct * aps;
3651  aps = new AdultSkylark_struct;
3652  aps->x = m_Location_x;
3653  aps->y = m_Location_y;
3654  aps->size = m_Size;
3655  aps->Terrs = m_OurTerritories;
3656  aps->L = m_OurLandscape;
3657  aps->sex = Sex;
3658  aps->age = 0;
3659  aps->bx = m_Born_x;
3660  aps->mh = m_MyHome;
3661  aps->by = m_Born_y;
3662  if ( Sex == true ) m_OurPopulationManager->CreateObjects( 3, this, NULL, aps, 1 ); else
3663  m_OurPopulationManager->CreateObjects( 4, this, NULL, aps, 1 );
3664  // object will be destroyed by death state
3665  // but must let Dad know anyway
3666  delete aps;
3667  if ( m_Dad != NULL ) m_Dad->OnPreFledgelingMature( this );
3668  // m_OurPopulationManager->WriteToTest2File(3,3);
3669 
3670 }
Definition: skylarks_all.h:251
double size
Definition: skylarks_all.h:253
bool sex
Definition: skylarks_all.h:254
int age
Definition: skylarks_all.h:255
int m_MyHome
The vegetation type where the skylark was born.
Definition: skylarks_all.h:600
int m_Born_y
Definition: skylarks_all.h:598
SkTerritories * m_OurTerritories
Definition: skylarks_all.h:602
int m_Born_x
Definition: skylarks_all.h:597
void OnPreFledgelingMature(Skylark_PreFledgeling *P)
Definition: skylarks_all.cpp:4497
void CreateObjects(int ob_type, TAnimal *pTAo, void *null, Skylark_struct *data, int number)
Definition: skylarks_all.cpp:557
int bx
Definition: skylarks_all.h:200
Landscape * L
Definition: skylarks_all.h:203
int x
Definition: skylarks_all.h:198
SkTerritories * Terrs
Definition: skylarks_all.h:204
int y
Definition: skylarks_all.h:199
int mh
Definition: skylarks_all.h:202
int by
Definition: skylarks_all.h:201
int m_Location_y
Definition: PopulationManager.h:228
int m_Location_x
Definition: PopulationManager.h:225

References AdultSkylark_struct::age, Skylark_struct::bx, Skylark_struct::by, Skylark_Population_Manager::CreateObjects(), Skylark_struct::L, Skylark_Base::m_Born_x, Skylark_Base::m_Born_y, Skylark_Nestling::m_Dad, TAnimal::m_Location_x, TAnimal::m_Location_y, Skylark_Base::m_MyHome, TAnimal::m_OurLandscape, Skylark_Base::m_OurPopulationManager, Skylark_Base::m_OurTerritories, Skylark_Base::m_Size, Skylark_struct::mh, Skylark_Male::OnPreFledgelingMature(), AdultSkylark_struct::sex, Skylark_Nestling::Sex, AdultSkylark_struct::size, Skylark_struct::Terrs, Skylark_struct::x, and Skylark_struct::y.

Referenced by EndStep().

◆ Step()

void Skylark_PreFledgeling::Step ( void  )
virtual

Step behaviour - must be implemented in descendent classes.

Reimplemented from Skylark_Nestling.

3495  {
3496 #ifdef __CJTDebug_5
3497  if ( IsAlive() != 0x0DEADC0DE ) DEADCODEError();
3498 #endif
3499  if ( m_StepDone ) return;
3500  switch ( m_CurrentSkState ) {
3501  case toss_Initiation: // Initial
3502  // Should never access this code becuase it should go
3503  // to m_CurrentSkState=toss_PDeveloping;
3504  g_land->Warn( "Skylark_PreFeldgeling::Step(): Ilegal ", NULL );
3505  exit( 1 );
3506  case toss_PDeveloping: // Develop
3507  m_StepDone = true;
3508  break;
3509  case toss_PMaturing: // Maturing
3510  m_StepDone = true;
3511  break;
3512  case toss_PDying: // Dying
3513  m_StepDone = true;
3514  break;
3515  case toss_Destroy:
3516  m_StepDone = true;
3517  break;
3518  default:
3519  g_land->Warn( "Skylark_PreFeldgeling::Step(): Unknown State ", NULL ); exit( 1 );
3520  }
3521 }
@ toss_Initiation
Definition: skylarks_all.h:45

References g_land, Skylark_Base::m_CurrentSkState, TALMaSSObject::m_StepDone, toss_Destroy, toss_Initiation, toss_PDeveloping, toss_PDying, toss_PMaturing, and Landscape::Warn().


The documentation for this class was generated from the following files: